#!/bin/sh -e

DATA_TYPES="users clients"
NUMBERS="1"
SIZES="1 10 100 1000"
COMMANDS="ser deser"
OUTPUT_DIR=output

echo ./gradlew clean build shadowJar
./gradlew clean build shadowJar

[ ! -d ${OUTPUT_DIR} ] && mkdir -p ${OUTPUT_DIR}

export SEED=${RANDOM}
export SHADOW="done"

for datatype in ${DATA_TYPES}; do
    for n in ${NUMBERS}; do
        for size in ${SIZES}; do
            for command in ${COMMANDS}; do
                outputFile="output/${datatype}-${command}-${n}-${size}.txt"
                echo ./run ${command} --number ${n} --size ${size} --datatype ${datatype}
                ./run ${command} \
                    --number ${n} \
                    --size ${size} \
                    --datatype ${datatype} \
                    | tee ${outputFile}
            done
        done
    done
done

